import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    dataPageData: null,
    test: []
  },
  mutations: {
    setDataPageData(state, value) {
      state.dataPageData = value
    },
    setTest(state, value) {
      state.test = value
    }
  },
  actions: {
    setDataPageData(context, value) {
      if (context.state.dataPageData !== value) {
        context.commit('setDataPageData', value)
      }
    }
  },
  modules: {}
})
